002 how i do it (part 1)
大家好,欢迎来到项目 11。
Hey Guys welcome to project 11.
这已经是老问题了,现在我们将建立一些主要的方法。
This is old hat by now we're going to be setting up some major ways.
而且您已经经历过一次,所以您可能在这个项目中度过了一段非常轻松的时光,说实话,您可能会在所有这些项目中度过一段非常轻松的时光,直到最后一个项目。
And you already have been through that once so you probably had a pretty easy time with this project and to be honest you're probably going to have a pretty easy time with all of these projects all the way up until the last one.
这将是一个技巧,因为您还没有设置数据采集。
And that's going to be a trick because you haven't set up data acquisition yet.
让我们继续,我们需要设置的第一件事不是屏幕,所以我将在这里创建一个新屏幕,我暂时在那里放置一个选择,我的分辨率是将会是 700 x 600,否则我认为一切都很好。
Let's go ahead and first thing we're going to need to set up a choice isn't a screen so I'm going to create a new screen here I'll just put a choice right there for the time being and my resolution is going to be 700 by 600 and otherwise I think everything is fine.
因此,让我们继续并点击“确定”,我将返回到我的欢迎屏幕并从这里抓取一些内容。
So let's go ahead and hit OK and I'm going to come back into my welcome screen and snatched some things out of here.
我会继续采取。
I'll go ahead and take.
好吧,你知道什么。
Well you know what.
让我们轻松一点。
Let's make it easy.
我只是要选择全部并复制。
I'm just going to select all and copy.
返回到我的屏幕,然后粘贴,然后我可以删除我不想要的内容。
Come back into my screen here and then paste and then I can delete out what I don't want.
所以我认为我不想要的一件事就是这两个按钮都在这里。
So one thing that I don't think I'm going to want is both of these buttons right here.
但我会继续保留其中之一。
But I will go ahead and keep one of them.
我不需要查看我的过滤器和储罐,但我可能会继续保留这些标签。
I'm not going to need to see my filter and storage tanks but I might go ahead and hang onto those labels.
至少其中之一,否则我想我想要我在这里看到的一切。
At least one of them and otherwise I think I want everything that I see here.
我现在正在考虑的另一件事是,让我们继续更改这里的标题。
And there's one other thing that I'm thinking right now is that so let's go ahead and change this title up here.
所以我将其称为设备控件。
So that's going to be I'll call it a device control.
那挺好的。
That's good.
你可以从那里结束,这听起来确实有点罗嗦,不是吗。
You can close out of there and it does sound a little bit wordy doesn't it.
让我们取出该设备,我们将其称为控制屏幕。
Let's take out the device let's just call it a control screen.
是的,我认为这样好一点。
Yeah I think that's a little bit better.
那么现在我们需要什么。
So now what do we need.
好吧,我想到的第一件事是我希望能够展示我的阀门和泵,这意味着我可以使用一些很酷的钹和阀门。
Well the first thing I'm thinking is that I want to be able to show my valves and my pump which means I get to go use some cool cymbals and for valves.
让我们看看,我认为这个看起来可能与我们这里的电磁阀一样接近,并且它是动画的。您可以看到我们有红色和绿色两种状态。
Let's see I think this one probably looks about as close to a solenoid valve as we've got here and it's animated You can see we've got two states red and green.
所以我要继续采取其中之一。
So I'm going to go ahead and take one of those.
当然,我也想要一个打气筒,并且我想尝试找到一个红色和绿色的打气筒,与它们搭配起来看起来不错。
And then of course I'm going to want a pump as well and I want to try to find a pump with the red and green that kind of looks good with those.
所以你知道什么让我们只看这一点。
So you know what let's look no further than that.
看起来确实是同一个人画的。
That looks like that was actually drawn by the same person.
完美的。
Perfect.
然后我可能最终会把它们做得更大一点。
And then I'm probably going to end up making those a little bit bigger.
因此,让我们继续取消这些尺寸的链接。
So let's go ahead and unlink those sizes.
我暂时不担心让它们变得更大,所以我只是要把它们放在这里。
And I won't worry about making them bigger for the time being so I'm just going to get them down here out of the way.
接下来我想要的是能够真正改变我的方式。
The next thing that I'm going to want is the ability to actually change my ways.
我一直在使用按钮。
I've been using push buttons on those.
但是我想继续使用按钮还是我喜欢使用一些滑块,也许只是为了好玩,尽管这不是我通常做的事情,但也许这一次只是一次。
But do I want to keep using push buttons or what I like to use some sliders and maybe just for fun even though it's not something that I normally do but maybe this time just for once.
我将继续使用滑块。
I'll go ahead and use sliders.
所以我要在这里放一个滑块,这是一个令人讨厌的大滑块。
So I'm going to put a slider in here and that is a big obnoxious slider.
希望这个东西能够很好地扩展,让我们尝试大幅缩小它。
Hopefully this thing scales halfway well let's try and shrink this down considerably.
做成那个大小就可以了。
Make it about that size.
然后让我们看看我们可以为小数做什么。
And then let's see what we can do here for our decimal.
我们知道这将为零。
We know that's going to be zero.
我们的最大值将保持不变,而我们的最小值将保持不变,我暂时不用担心标签。
Our maximum is going to be to our minimum is going to stay the same and I won't worry about the tag for the time being.
所以让我们离开那里吧。
So let's close out of there.
我现在只想把这个推到那里。
And I'm just going to push this right there for right now.
我已经把我的阀门放在这里了,实际上我要把它放低一点,因为我想在上面贴上一个标签,这样在接近时它就会成为 V-1。
I've got my valve down here actually I'm going to drop this down a little bit because I want to put a label on that so that'll be as V-1 in close out of there.
这给了我我想要的间距。
And that gives me about the spacing that I want.
我要在这里休息一下,然后继续设置我的标签。
I'm going to take a break here and go ahead and set up my tags.
然后我将在运行时跳入这个东西,看看它是什么样子。
And then I'm going to jump into this thing on run time and just see what it looks like.
因此,让我们进入全局,我们将返回标签的数据表视图,我想这些标签已经为我们打开了。
So let's go down here into global and we're going to come back into our data sheet view for our tags which I guess was already open for us.
让我们继续创造这些。
And let's go ahead and create these always.
因此,我们将 H-2A 下划线作为一个,我将复制其中的大部分内容,以便我可以将其与二三四五和六粘贴在这里,然后我也希望我的泵一好。
So we've got H-2A underscore as the one and I will copy most of that so that I can just paste it right here with a two three four five and six and then I'm also going to want my pump one good.
默认情况下,这些都设置为整数。
And those are all set up as integers by default.
所以效果很好。
So that works out nicely.
然后我们已经有了泵 1 的指示器。
And then we already have our indicator for pump 1.
但我们还需要阀门指示器。
But we're also going to need our indicators for our valves.
所以我将下划线设置为 V-1,你已经知道了。
So I and the underscore as V-1 and you already know it.
我要做一个大的复制并粘贴在上面。
I'm going to do a big copy and paste on that.
所以二三四五六。
So two three four five and six.
然后如果你想一想,因为我们将尝试使用滑块来实现这些,这意味着我们不必为 H.O. 执行所有这些按钮。
And then if you think about it since we're going to try to use sliders for these that means we're not going to have to do all of those pushbuttons for H.O.
所有这些设备上的方式。
way on all of these devices.
我想说这是不太理想的编程,因为我讨厌使用滑块,我喜欢使用按钮,因为它更精确。
This is I would say less than desirable programming because I hate using sliders I love using buttons are so much more precise.
你不必从一个位置滑到另一个位置,只是为了稍微偏离一点,做一些不同的事情。
You don't have to slide through one position to get to another one just to deviate a little bit and do something a little bit different.
我想就这一次就好了。
I think it's going to be all right just this once.
所以我有我的设备的所有指标我有我的设备的所有选择。
So I've got all my indicators for my devices I've got all my choice for my devices.
我想这就是我屏幕上需要的一切。
I think that's everything I'm going to need on my screen.
那么让我们回到这里吧。
So let's go back in here.
现在我实际上可以将其联系起来。
And now I can actually link this up.
因此,它的标签名称将是整数,这将是我的 SLV 方式。
So the tag name for this is going to be integer and that's going to be my way for SLV one.
实际上,让我们继续尝试一下这个标签。
And actually let's go ahead and try this label out.
因此,我将继续输入 SLV 1,如果我喜欢它的外观,我可能会保留它,但我现在警告您,我可能只是将这个标签去掉,这样我就可以使用我自己的标签,这样我就可以更好地控制它。
So I'm going to go ahead and type SLV one if I like the way that it looks I might leave it but I'll warn you now I'm probably just going to take this label out so I can use my own label and that way I can have a lot more control over it.
因此,让我们按照现在的情况结束吧。
So let's take that as is right now close out.
是的,我认为标签会出现在底部,而且我认为它看起来会很糟糕。
And yeah I think that labels are going to appear down here on the bottom and I think it's going to look bad.
没有把握。
Not sure.
我们会知道的。
We'll find out.
然后,对于我的阀门,我可以继续进行设置,而不是缓慢闪烁。
Then for my valve I can go ahead and set that up instead of Blink slow.
我将把它链接到我的 SUV 的一个指示器,就在这里。
I'm going to link that to my SUV one indicator which is right here.
明白了,让我们结束这里,然后我需要设置其余的标签。
Gotcha And let's close out of there and then I need to set up the rest of my tags.
因此,让我们进入这里的驱动程序,我们已经创建了所有标签。
So let's go into the driver here and we already created all the tags.
现在我们只需填充它们即可。
Now we've just got to populate them.
所以回到项目中,拿我的 HMO a p 1 s v1 v2。
So go back into project take my HMO a p 1 s v1 v2.
我想你现在已经知道该怎么做了。
And I think you know the drill by now.
我只是要确保在这里添加所有新的以及我专门为此屏幕创建的内容,然后也放入所有这些地址。
I'm just going to make sure to add everything in here that is new and that I've created just for this screen and then drop in all of those addresses as well.
我已经得到了 P1 的指标。
I've already got my indicator for P1.
所以我只需要 s v 1 到 6 的指标,然后只需深入研究程序并找出所有这些满意的地址,将它们写在这里,然后我们就可以了。
So I just need my indicators for s v 1 through 6 and then it's going to be just a matter of digging through the program and pulling out all of these happy addresses getting them written in here and then we'll be good.
看起来这个标签已经配置为另一个 O 哦,因为我点击的是 HL 方式而不是指示器,所以让我们再试一次。
It looks like this tag was already configured to another O oh because I'm clicking on the HL way instead of the indicators so let's try that again.
我们需要指标。
We want indicator for us.
V-6 不错。
V-6 good.
我相信我的 HMO A 是七分之四的零到七。
And my HMO A's I believe four in seven zero through seven.
让我们继续检查一下,因为我可能可以很快地将它们放入其中。
Let's go ahead and check that out because I can probably pop those in there real quick.
是的,从 7 点 0 开始。
Yeah that starts off at 7 0.
所以我可以从这里开始,实际上我知道 77 中的内容,对于其余的内容,我可以复制并粘贴它,并对其进行非常轻松的工作。
So I can just start right here and actually I know the is in 77 and for the rest of these I can just copy and paste that and make really light work of it.
事实上,我相信那是在 76 年,因为我是从零开始的。
Actually I believe that was in 76 since I'm starting at zero.
所以我应该有 0 1 2 3 4 和 5,我认为我的这些指标也设置得非常简单。
So I should have 0 1 2 3 4 and 5 and I think my indicators for these were also set up pretty simple.
那么让我们进入ioe。
So let's come into ioe.
这里我们有 SB 1,我们得到的是 B-3 0 1 2 3 4 5 6 7。
And here we have SB 1 and we've got that is B-3 0 1 2 3 4 5 6 7.
哇,那可真好。
Wow that's nice.
那么让我们回到这里。
So let's jump back in here.
这是 B-3 呼叫和 0 斜线 1。
That's B-3 call and 0 slash 1.
让我们复制其中的大部分内容。
And let's copy most of that.
看。
See.
当您编写一个好的程序时,设置这些标签可能非常简单。
Setting up these tags can be real simple when you write a good program.
我喜欢认为我的程序并不糟糕。
And I like to think my program isn't terrible.
五六,我们已经有了指标,那就是 3 0 7。
So five six and we already have our indicator and that's be 3 0 7.
就像我们已经设置了所有标签一样,我将单击全部保存,对于此屏幕,我将其保存为 H-2A,点击保存。
So just like that we've got all of our tags set up I'm going to click save all and for this screen I'm going to save it as H-2A hit save.
现在我已经保存了它,我还可以为其创建一些导航。
And now that I've got that saved I can also create some navigation to it.
所以第一个打开的屏幕将指向我的 HBO 方式。
So this first one open screen is going to point to my HBO way.
没关系。
That's OK.
然后我们可以返回到按钮,让我们将其更改为 H-L 方式,我们可以从那里关闭,然后我们还将在这里放置一些返回导航。
And then we can go back to button and let's just change that to say H-L way and we can close out of there and then we'll also put some return navigation in here.
因此,如果我们双击此按钮,我们将打开屏幕,这将是我们的欢迎屏幕。
So if we double click on this button we're going to open the screen and that's going to be our welcome screen.
如果我们返回按钮,我们将更改标题以显示“欢迎巴解组织退出”。
And if we go back to button we will change the caption to read welcome PLO's out.
让我们初步了解一下这个东西。
And let's just do an initial look on this thing.
这并不是真正的测试,但我只是想看看我在这里正在做什么。
Not really a test but I just want to see what I'm working with here.
我绝对不喜欢他们的标签。
I definitely don't like their labels on that.
这对我没有任何好处。
It doesn't do me any good.
然后我把这个指示器的实际表盘飞到了这里的顶部。
And then I've got the the actual dial for this indicator flying way up the top here.
好吧,我仍然想使用滑块,但我必须稍微操作一下,因为正如你所看到的,每当我加载这个东西时,我的小滑块表盘离顶部太远,所以我需要修改它一点。
Well I still want to use the slider but I'm going to have to operate a little bit because as you can see whenever I loaded this thing up my little slider dial was going way too far off the top so I need to modify that a little bit.
所以我要右键单击它,然后单击取消链接链接符号。
So I'm going to right click on this and let's click on unlink link symbol.
所以现在我们已经把一切都分解了。
So now we've broken everything into pieces.
现在让我们来解决这个问题。
And now let's work with this.
首先,我想检查双击这个小滑块。
So to start with I want to check double click on this little slider.
我已经将最小值和最大值设置为从 0 到 2,但我也想更改这些位置,以便我的位置从零到负三百。
I've got the min and max set from 0 to 2 but I also want to change these positions so positions I've got from zero to negative three hundred.
我将尝试改变这个立场。
I'm going to try and change this position.
所以,不要用负 300,让我们看看当我在其中输入负 150 时会发生什么。
So instead of negative three hundred Let's see what happens when I put negative 150 in there.
所以我要尝试一下。
So I'm going to try that.
关闭它,然后让我们返回运行,看看这个控件会发生什么。
Close it and then let's go back into run and just see what happens with this control.
因此,我们将等待知道我们正在沟通,我认为我们正在沟通,然后看看这一点。
So we're going to wait to know that we're communicating and I think we are and look at that.
现在我已经让这件事按照我想要的方式发展了。
Now I've got this thing moving just the way that I want it.
所以我对此很满意。
So I'm happy with that.
现在我这里有了这个数字指示器,告诉我它的值是什么,这很好。
Now I've got this numeric indicator down here telling me what the value of that is and that's fine.
但我想我宁愿让它显示为侧面的数字。
But I think I'd rather have it appear as a number on the side.
因此,让我们继续看看是否可以实现这一目标。
So let's go ahead and see if we can make that happen.
我要删除这里的这些标签,因为我真的不需要它们。
I'm going to delete out these labels down here because I really don't need those.
然后让我们看看是否有一种方法可以真正处理这里的形状。
And then let's see if there's a way that we can actually work on the shape here.
我想去掉这条线,我想去掉中间的这条线。
I want to get rid of this line and I want to get rid of this line right here in the middle.
我们就这样吧。
So there we go.
让我们摆脱它,然后我还想在其中添加更多标签。
Let's just get rid of that and then I also want to put some more labels in there.
所以我得到了这个我很满意的标签。
So I've got this label that I'm happy with.
让我们复制并粘贴它,我只需将其更改为 0,然后我将需要另外两个。
Let's copy and paste that and I'm just going to change this to read 0 and then I'm going to need two more of those.
因此,让我们复制并粘贴一二,我将把它们拉到这里。
So let's copy and paste one two and I'm just going to pull these down here.
这个将是一个,我们将制作一个或两个。
This one is going to be a one and we'll make this one or two.
好的。
All right.
所以我要把它放在这条线旁边。
So I'm going to put that to right up here next to this line.
将其放在该行旁边,将 0 放在这里,然后我想我需要对此符号进行一些微调,以将这些东西准确地移动到我想要的位置。
Put that one right here next to that line put my 0 down here and then I think I'm going to need to do some fine tuning on this symbol to move these things exactly where I want them.
因此,回到图形网格设置并继续关闭我的快照,然后我将像这样绘制一条参考线。
So that's come back into the graphics grid settings and go ahead and turn off my snap then I'm going to draw a reference line just like that.
没什么大不了的,我会把它拉到那里。
Not a big deal and I'm going to pull that right about there.
那么让我们继续放大一点。
So let's go ahead and zoom in a little bit.
我将去查看缩放区域,并且我想直接放大到此区域。
I'll go to view the zoom area and I want to zoom right into this.
现在让我们继续将一些内容移到我想要的位置,这样我的 SCV one 标签就在那里看起来很棒。
Now let's go ahead and move some things where I want them so my SCV one label looks great right there.
这看起来也不错,然后我将拉出我的参考线,以便我可以将我的参考线与 0 中的那条线对齐。
This too looks good about there and then I'm going to pull over my reference line so that I can line up my one with that line in my 0.
我喜欢它所在的地方。
I like that right where it is.
那么让我们继续回到 100% 的正常变焦。
So let's go ahead and go back to our normal zoom of 100 percent.
我可以去掉我的参考线,然后让我们重新打开快照,以防万一我们需要它。
I can get rid of my reference line and then let's turn snap back on just in case we need it.
所以回到网格设置对齐网格就OK了。
So back to grid settings snap to grid OK.
现在让我们继续选择这里的所有内容。
And now let's just go ahead and select everything here.
我想尝试获得除了我的 SFE one 标签之外的所有东西。
And I want to try to get everything except my SFE one label.
因此,让我们继续尝试选择除我的小标签之外的所有内容。
So let's go ahead and try to select everything except for my little label up there.
他们不想右键单击它并创建链接符号,然后我将继续将其放入滑块中,我将其称为 H-2A P.L.
They don't want to right click on this and create link symbol and then I'll go ahead and put this into sliders and I'll just call this H-2A P.L.
对我来说足够好并保存它。
good enough for me and save it.
现在我们有了自己的小自定义滑块。
So now we've got our own little custom slider.
就这个标签而言,我想我会把它做得更大一点。
And as far as this label I think I'm going to make that just a little tiny bit bigger.
因此,让我们继续将屏幕的数量增加到 16。
So let's go ahead and kick that up to 16 for the screen.
好的。
All right.
我想我也会把它提高几个档次,现在我认为可以肯定地说,我们也可以让我们的阀门更大一点,他们会用我的泵做同样的事情,我只是要把它放在阀门旁边作为参考,这样我就可以准确地看到我把它做得有多大,看起来还不错。
And I think I'll also move that up a couple of notches and now I think it's safe to say that we can also make our valves a little bit larger and they'll do the same thing with my pump I'm just going to put that next to the valve for reference so I can see exactly how big I'm making it that looks decent.
我将把它移开,现在我想我已经有了这个屏幕的基础。
I'm going to move that out of the way and now I think I've got the basis for this screen.
我想我已经准备好继续创建所有其余的东西并将其展开。
And I think I'm ready to go ahead and create all the rest of this stuff and lay it out.
所以我想我们还是先在这里休息一下吧。
So I think we'll go ahead and take a break here.
我将在下一堂课中回来,我将创建其余的控件和显示,并将所有内容都放在屏幕上。
I'll come back in the next lecture and I'll create the rest of my controls and displays and lay everything out on the screen.
还有一场讲座来测试这个东西。
And one more lecture to test this thing.
我想我们将会完成这个项目。
And I think we'll be done with this project.
我会在接下来的欢呼声中见到你。
I'll see you in the next cheers.